tools/ocaml: ask compiler for correct library
authorMike McClurg <mike.mcclurg@citrix.com>
Tue, 21 Jun 2011 17:01:51 +0000 (18:01 +0100)
committerMike McClurg <mike.mcclurg@citrix.com>
Tue, 21 Jun 2011 17:01:51 +0000 (18:01 +0100)
OCaml libraries will live in /usr/local/ if the user compiles OCaml
from source. This patch asks the OCaml compiler where we should look
for libraries.

NB: it may be that we should do the same thing for the NetBSD case,
but I don't have a BSD box to test this out.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/ocaml/common.make

index 04a0b6b1fff290a62381808a154cf9dcc688f14f..17a300c807ac5c2fd94f74ffe733db8542daa7f7 100644 (file)
@@ -9,7 +9,7 @@ OCAMLLEX ?= ocamllex
 OCAMLYACC ?= ocamlyacc
 
 CFLAGS += -fPIC -Werror
-CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml
+CFLAGS-$(CONFIG_Linux) += -I$(shell ocamlc -where)
 CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')